﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.Mvc;

namespace SDT.Systems
{
    /// <summary>
    /// Author: Takamaru Nguyen
    /// Date: 13/06/2011
    /// </summary>
    public class CommonType
    {
        public enum Codes
        {
            UNPUB,
            PUB
        }

        private static string[] Descriptions = new string[] { "Không kích hoạt", "Đang kích hoạt" };

        public string GetDes(Codes c)
        {
            return Descriptions[(int)c];
        }

        public List<SelectListItem> ToList()
        {
            List<SelectListItem> listCode = new List<SelectListItem>();
            Array A = Enum.GetValues(typeof(Codes));

            for (int i = 0; i < Descriptions.Length; i++)
            {
                SelectListItem item = new SelectListItem();
                item.Text = Descriptions[i];
                item.Value = i.ToString();

                listCode.Add(item);
            }

            return listCode;
        }
    }

    /// <summary>
    /// Author: Takamaru Nguyen
    /// Date: 13/06/2011
    /// </summary>
    public class StatusType
    {
        public enum Codes
        {
            NOT,
            HOT
        }

        private static string[] Descriptions = new string[] { "Không hot", "Tin hot" };

        public string GetDes(Codes c)
        {
            return Descriptions[(int)c];
        }

        public List<SelectListItem> ToList()
        {
            List<SelectListItem> listCode = new List<SelectListItem>();
            Array A = Enum.GetValues(typeof(Codes));

            for (int i = 0; i < Descriptions.Length; i++)
            {
                SelectListItem item = new SelectListItem();
                item.Text = Descriptions[i];
                item.Value = i.ToString();

                listCode.Add(item);
            }

            return listCode;
        }
    }
}
